import {
	myRequest
} from "./apiRequest"
export const mallApi = {
	getGoodsType: (data) => { //获取商品分类
		return myRequest('api/category', 'get', data)
	},
	getGoodsList: (data) => { //商品列表
		return myRequest('api/products', 'get', data)
	},
	getHotList: (data) => { //特惠商品列表
		return myRequest('api/product/hot', 'get', data)
	},
	getBrandList: (data) => { //品牌列表
		return myRequest('index/brand', 'post', data)
	},
	getGoodsDetail: (data) => { //获取商品详情
		return myRequest('api/product/detail/' + data.id, 'get')
	},
	getAddTempCar: (data) => { //添加临时购物车
		return myRequest('api/order/confirm', 'post', data)
	},
	creatCarOrder: (data) => { //购物车购买
		return myRequest('user_order/pre_order_info', 'post', data)
	},
	//订单
	createOrder: (data) => { //创建订单
		return myRequest(`api/order/create/${data.key}`, 'post', data.data)
	},
	computedMoney: (data) => { //计算订单价格
		return myRequest(`api/order/computed/${data.key}`, 'post', data.data)
	},
	getOrderList: (data) => { //订单列表
		return myRequest('api/order/list', 'get', data)
	},
	getOrderDetail: (data) => { //订单详情
		return myRequest(`api/order/detail/${data.order}`, 'get')
	},
	submitOrderPay: (data) => { //订单详情
		return myRequest(`api/order/pay`, 'post', data)
	},
	applySales: (data) => { //申请售后
		return myRequest('api/order/refund/verify', 'post', data)
	},
	getApplyInfo: (data) => { //申请售后
		return myRequest('user_order_return/read', 'post', data)
	},
	updateOrderStatus: (data) => { //取消订单
		return myRequest('api/order/cancel', 'post', data)
	},
	//添加/修改我的商品
	addProduct: (data) => {
		return myRequest('product_manage/save', 'post', data)
	},
	getMyGoodsList: (data) => { //获取我的商品列表
		return myRequest('product_manage/list', 'post', data)
	},
	getMyGoodsDetail: (data) => { //获取我的商品详情
		return myRequest('product_manage/read', 'post', data)
	},
	//收藏
	addCollect: (data) => { //添加
		return myRequest('user_storeup/save', 'post', data)
	},
	cancelCollect: (data) => { //取消
		return myRequest(`user_storeup/del?id=${data}`, 'post', {})
	},
	collectList: (data) => { //列表
		return myRequest(`user_storeup/list`, 'post', data)
	}, //清单
	addQingdan: (data) => { //添加
		return myRequest('user_collect/save', 'post', data)
	},
	cancelQingdan: (data) => { //取消
		return myRequest(`user_collect/del?id=${data.id}`, 'post', data)
	},
	qingdanList: (data) => { //列表
		return myRequest(`user_collect/list`, 'post', data)
	},
	//积分
	getScoreGoodsList: (data) => { //商品列表
		return myRequest('score_product/list', 'post', data)
	},
	getScoreInfo: (data) => { //积分明细
		return myRequest('user_score/lists', 'post', data)
	},
}